import Router from 'vue-router'

import share from '@/page/share/share'
import about from '@/page/about/about'
import wifi from '@/page/wifi/portal'
import lock from '@/page/lock/lock'
import wifiBefore from '@/page/wifi/wifi-before'

import shop from '@/page/shop/shop'
import shopDetail from '@/page/shop/shop-detail'
import shopMap from '@/page/shop/map'

import course from '@/page/course/course'
import coursePerson from '@/page/course/course-person'
import courseList from '@/page/course/course-list'
import courseDetail from '@/page/course/course-detail'
import courseDetailPerson from '@/page/course/course-detail-person'
import order from '@/page/course/order'
import orderPerson from '@/page/course/order-person'

import appointment from '@/page/appointment/appointment'
import appointmentDetail from '@/page/appointment/appointment-detail'
import appointmentSign from '@/page/appointment/appointment-sign'

import vip from '@/page/person/vip'
import paymentRecord from '@/page/person/payment-record'
import refundRecord from '@/page/person/refund-record'
import message from '@/page/person/message-record'
import messageDetail from '@/page/person/message-detail'
import pay from '@/page/person/pay'
import withdraw from '@/page/person/withdraw'
import coupons from '@/page/person/coupons'
import orderList from '@/page/person/order-list'

import tab from '@/page/tab'

export default new Router({
  routes: [
    {
      path: '/about',
      name: 'about',
      component: about
    }, {
      path: '/lock',
      name: 'lock',
      component: lock
    }, {
      path: '/wifi',
      name: 'wifi',
      component: wifi
    }, {
      path: '/wifiBefore',
      name: 'wifiBefore',
      component: wifiBefore
    }, {
      path: '/share',
      name: 'share',
      component: share
    }, {
      path: '/',
      name: 'tab',
      component: tab,
      redirect: '/shop',
      children: [
        {
          path: 'shop',
          name: 'shop',
          component: shop
        }, {
          path: 'course',
          name: 'course',
          component: course
        }, {
          path: 'coursePerson',
          name: 'coursePerson',
          component: coursePerson
        }, {
          path: 'appointment',
          name: 'appointment',
          component: appointment
        }, {
          path: 'vip',
          name: 'vip',
          component: vip
        }
      ]
    }, {
      path: '/course/:course_id',
      name: 'course_detail',
      component: courseDetail
    }, {
      path: '/course/person/:course_id',
      name: 'course_detail_person',
      component: courseDetailPerson
    }, {
      path: '/coach/:coach_id/courses',
      name: 'coach_course',
      component: courseList
    }, {
      path: '/courses/:course_id/appointments/:id',
      name: 'appoint_sign',
      component: appointmentSign
    }, {
      path: 'appointment/appointmentDetail',
      name: 'appointment_detail',
      component: appointmentDetail
    }, {
      path: '/map',
      name: 'shopMap',
      component: shopMap
    }, {
      path: '/pay/recharge',
      name: 'pay',
      component: pay
    }, {
      path: '/pay/withdraw',
      name: 'withdraw',
      component: withdraw
    }, {
      path: '/shop/:shop_id',
      name: 'shopDetail',
      component: shopDetail
    }, {
      path: 'shop/:shop_id/courses',
      name: 'courseList',
      component: courseList
    }, {
      path: '/vip/payment',
      name: 'paymentRecord',
      component: paymentRecord
    }, {
      path: '/vip/refund',
      name: 'refundRecord',
      component: refundRecord
    }, {
      path: '/vip/message',
      name: 'message',
      component: message
    }, {
      path: '/vip/message/:message_id',
      name: 'message_detail',
      component: messageDetail
    }, {
      path: '/vip/orders',
      name: 'orders',
      component: orderList,
      children: [
        {
          path: ':order_id',
          name: 'order_detail',
          component: order
        }
      ]
    }, {
      path: '/vip/coupons',
      name: 'coupons',
      component: coupons
    }, {
      path: '/pay/course',
      name: 'pay_course',
      component: order
    }, {
      path: '/pay/course_person',
      name: 'pay_course_person',
      component: orderPerson
    }
  ]
})
